home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 3⁄23⁄90 / 0956-Re two TEedit record-Mar90 < prev    next >
Encoding:
Text File  |  1990-03-23  |  1.5 KB  |  55 lines  |  [TEXT/GEOL]

  1. Item    1864731                         21-March-90        14:31PST
  2.  
  3. From:   MACAPP.ADMIN                    Design Methodology,Joel Norvell,VCA
  4.  
  5. To:     DAWSON.M                        Dawson, Mark
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: two TEedit records in…
  10.  
  11. Hi Mark,
  12.  
  13. You need to subclass TTEView and  OVERRIDE its DoMouseCommand to set the target
  14. to the "hit" TEView. Of course, the target only needs to be reset if you are
  15. changing TEViews. Doing this might be complicatated slightly by the fact that
  16. you're in a dialog view.
  17.  
  18. Best regards - Joel
  19.  
  20. {-----------------------------------------------------------------------------}
  21. {$S YourSegmentName}
  22.  
  23. FUNCTION  TMyTEView.DoMouseCommand
  24.             (  VAR theMouse:       Point;
  25.        VAR info:          EventInfo;
  26.        VAR hysteresis:   Point): TCommand; OVERRIDE;
  27.    VAR
  28.    theTarget:  TView;
  29.  
  30. BEGIN
  31. {$IFC qDebug}
  32.    Writeln('Mouse in TEView');
  33. {$ENDC}
  34.  
  35.    DoMouseCommand := gNoChanges;
  36.  
  37.    theTarget := TView(TWindow(SELF.GetWindow).fTarget);
  38.    {First find target by looking in window !!!}
  39.  
  40.    IF theTarget <> SELF THEN
  41.    BEGIN
  42.  
  43.    { We won't have to UnDo any TextView selection in
  44.     our SuperView's DoMouseCommand.
  45.      That is taken care of by the SetTarget call to InstallSelection.}
  46.  
  47.    TWindow(SELF.GetWindow).SetTarget(SELF);
  48.    END;
  49.  
  50.    DoMouseCommand := INHERITED DoMouseCommand(theMouse, info, hysteresis);
  51. END;
  52.  
  53. {-----------------------------------------------------------------------------}
  54.  
  55.